<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------
namespace Api\Service;

class ShareService{
	
    /**
     * 记录用户打开分享记录
     * @return unknown
     */
    public function save($param){
        $Model = M('share');
        return $Model->add($param);
	}
	
	public function validateParam($param){
	    switch ($param['method']) {
	        case 'save':
	            if(empty($param['share_uid'])) {
	                E('分享人不能为空！');
	            }
	            if(empty($param['open_uid'])) {
	                E('打开分享人不能为空！');
	            }
	            if(empty($param['path'])) {
	                E('路径不能为空！');
	            }
	            break;
	        default:
	            return '';
	    }
	}
}